//
//  ByScanCodeSuccessVC.m
//  mijifen_ios
//
//  Created by mc on 2017/11/7.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByScanCodeSuccessVC.h"

// view
#import "ByViewHeaderSuccess.h"

@interface ByScanCodeSuccessVC ()

@end

@implementation ByScanCodeSuccessVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"扫码收款";
    [self addLeftBackBarButtonItem];
    [self createViews];
}

#pragma mark - 创建视图
- (void)createViews{
    ByViewHeaderSuccess *headerView = [[ByViewHeaderSuccess alloc] initWith:@"StoreCollection_paysuccess" title:@"收款成功"];
    [self.view addSubview:headerView];
    __block CGFloat height;
    [headerView mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0,*)) {
            height = (self.view.height - 50 * 2 - 10 - self.view.safeAreaInsets.bottom) / 2;
            make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, height));
        }else{
            height = (self.view.height - 50 * 2 - 10) / 2;
            make.top.equalTo(self.view.mas_top);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, height));
        }
        
    }];
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:backButton];
    [backButton mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0,*)) {
            make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
        }else{
            make.bottom.equalTo(self.view.mas_bottom);
        }
        make.left.equalTo(self.view.mas_left);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 50));
    }];
    [backButton setTitle:@"返回首页" forState:UIControlStateNormal];
    [backButton setTitleColor:BY_TEXT_COLOR forState:UIControlStateNormal];
    [backButton setBackgroundColor:BY_THEME_COLOR];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
